#!/bin/bash

# Test reweight
. ./common

_need_to_be_root

_make_device 0 $((200 * 1024 ** 2))
_make_device 1 $((200 * 1024 ** 2))
_make_device 2 $((200 * 1024 ** 2))
_make_device 3 $((200 * 1024 ** 2))
_make_device 4 $((200 * 1024 ** 2))
_make_device 5 $((200 * 1024 ** 2))

#start three in different size
for i in 0 1 2; do
	_start_sheep $i
done
_start_sheep 3 "-g"
_wait_for_sheep 4
_cluster_format -c 1

$DOG vdi create test 200M -P
_node_info
$DOG node list

$DOG node md plug -f $STORE/4
_wait_for_sheep_recovery 0

$DOG cluster reweight
_start_sheep 5
_wait_for_sheep 5
_wait_for_sheep_recovery 0
_node_info
$DOG node list
$DOG cluster info | _filter_cluster_info
